// api/cart.js
import request from '../utils/request'


export function addCartFn (params) {
  return request({
    url: '/cart/add',
    method: 'POST',
    data: params,
    header: {
      token: wx.getStorageSync('token') || ''
    }
  })
}

export function getCartListData (params) {
  return request({
    url: '/cart/list',
    method: 'POST',
    data: params,
    header: {
      token: wx.getStorageSync('token') || ''
    }
  })
}

export function removeCartData (params) {
  return request({
    url: '/cart/remove',
    method: 'POST',
    data: params,
    header: {
      token: wx.getStorageSync('token') || ''
    }
  })
}
export function selectAllData (params) {
  return request({
    url: '/cart/selectall',
    method: 'POST',
    data: params,
    header: {
      token: wx.getStorageSync('token') || ''
    }
  })
}
export function selectOneData (params) {
  return request({
    url: '/cart/selectone',
    method: 'POST',
    data: params,
    header: {
      token: wx.getStorageSync('token') || ''
    }
  })
}

export function updateNum (params) {
	return request({
		url: '/cart/updatenum',
    method: 'POST',
    data: params,
    header: {
      token: wx.getStorageSync('token') || ''
    }
	})
}